package com.ahau.gateway.Config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author xiao hu die
 * @Date 2022/1/2 14:10
 * @Version 1.0
 */
@Configuration
public class GateWayConfig {
 @Bean
 public RouteLocator routeLocator(RouteLocatorBuilder routeLocatorBuilder){
  RouteLocatorBuilder.Builder routes = routeLocatorBuilder.routes();
  routes.route("payment_test",x->x.path("/guoji").uri("https://news.baidu.com/guoji")).build();

  return routes.build();
 }
}
